package cn.dansj.common.utils.bean;

import java.util.Objects;

/*
 * db connection info
 * */
public class DBConnection extends UserPwd {
    private String url;

    public DBConnection() {
        super("", "");
    }

    public DBConnection(String url, String username, String password) {
        super(username, password);
        this.url = url;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DBConnection that = (DBConnection) o;
        return Objects.equals(url, that.url) && Objects.equals(getUsername(), that.getUsername()) && Objects.equals(getPassword(), that.getPassword());
    }

    @Override
    public int hashCode() {
        return Objects.hash(url, getUsername(), getPassword());
    }
}
